﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Import Namespace="Microsoft.SharePoint" %>

<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
<%@ Register Tagprefix="AdminControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint.ApplicationPages.Administration" %>

<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>

<%@ Page Language="C#" 
	AutoEventWireup="true" 
	CodeBehind="DataConnectionManager.aspx.cs"
	Inherits="SpugPt.DataConnManager.SpugPtDataConnManager" 
	MasterPageFile="~/_admin/admin.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">

	<asp:Panel ID="inputControls" runat="server">
	<SharePoint:ScriptLink ID="showDailog" runat="server" Name="sp.js" Localizable="false" LoadAfterUI="true" /> 
	<wssuc:ToolBar id="onetidMngFieldTB" runat="server">
		<template_buttons>
			<wssuc:ToolBarButton runat="server"
			Text="Create new Key"
			id="idAddField"
			ToolTip="< %$Resources:wss,mngctype_create_alt%>" 
			NavigateUrl="EditDataConnection.aspx" ImageUrl="/_layouts/images/newitem.gif"
			AccessKey="K" />
		   
		   
		</template_buttons>
		<Template_RightButtons>

			<wssawc:WebApplicationSelector id="Selector" runat="server"
				AllowAdministrationWebApplication = "false"               
				TypeLabelCssClass="ms-listheaderlabel"
				NoSelectionText=""
				ClearSelectionText=""
				HoverCellActiveCssClass = "ms-viewselectorhover"
				HoverCellInActiveCssClass = "ms-viewselector" />
		</asp:PlaceHolder>
		</Template_RightButtons>
</wssuc:ToolBar>
 <SharePoint:SPGridView
			id="DgItems"
			runat="server"
			AutoGenerateColumns="false"
			width="100%"
			AllowGrouping = "false"
			AllowGroupCollapse = "false"
			AllowSorting="False" >
		<AlternatingRowStyle CssClass="ms-alternatingstrong" />
		<Columns>
             
			<asp:TemplateField
				SortExpression="Name"
				HeaderText="Name">
				<ItemStyle VerticalAlign="Top" />
				<ItemTemplate>
				   <%#GetLink(DataBinder.Eval(Container.DataItem, "Name").ToString(),DataBinder.Eval(Container.DataItem, "Value").ToString(),"EDIT=1")%>
				</ItemTemplate>
			</asp:TemplateField>
			 <asp:BoundField
				HeaderText="Value"
				SortExpression="Value"
				DataField="Value" />
            
			
		</Columns>
	  </SharePoint:SPGridView>
	  
<script type="text/javascript">
  
	
	function openPopup(webid,  name,value, operation) {
	 var page = "EditDataConnection.aspx?";
		page = page + 'WebId=' + webid;
		page = page + '&&Name=' + name;
		page = page + '&&Value=' + value;
		if (operation != null)
			page = page + '&&' + operation ;
		commonShowModalDialog(page, "resizable: no; status:no; scroll: no; help: no; center: yes; dialogwidth:650px; dialogHeight:350px;", callback,null);
		location.reload(true);        
	}
	//Retreives the value sent from the popup
	function callback(retValue) {
		alert(retValue);
	}
	

	

	</script> 


	</asp:Panel>
	<!-- Literal Control to display messages -->
	<div style="font-size: 12pt; color: red; font-weight: bold;">
		<asp:Literal ID="litMessages" runat="server" />
	</div>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
   DataConnection Manager
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
   DataConnection Manager
</asp:Content>

<asp:Content ID="PageDescription" ContentPlaceHolderID="PlaceHolderPageDescription" runat="server">
	Manage Web Application DataConnection settings.
</asp:Content>

